<template>
  <div>
    <router-view></router-view>
    <div class="kong"></div>
    <!-- 底部 -->
    <van-tabbar v-model="active" fixed>
      <van-tabbar-item icon="wap-home-o" @click="$router.push('/')"
        >首页</van-tabbar-item
      >
      <van-tabbar-item icon="user-circle-o" dot>会员</van-tabbar-item>
      <van-tabbar-item
        icon="shopping-cart-o"
        :badge="num"
        @click="$router.push('/cat')"
        >购物车</van-tabbar-item
      >
      <van-tabbar-item icon="search" badge="20">搜索</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
import { mapState, mapMutations } from "vuex";
export default {
  computed: {
    ...mapState(["num"]),
  },

  data() {
    return {
      active: 0,
    };
  },
};
</script>

<style>
.kong {
  height: 50px;
}
.van-ellipsis {
  color: #26a2ff;
  font-weight: 700;
}
</style>
